package com.lvmama.rhino.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lvmama.rhino.mapper.VisitorMapper;
import com.lvmama.rhino.pojo.VisitorInfo;
import com.lvmama.rhino.service.VisitorService;
@Service("visitorService")
public class VisitorServiceImpl implements VisitorService{
	@Autowired
	private VisitorMapper visitorMapper;

	/** 
	* @Title: getVisitorListByDate 
	* @Description: 访客趋势图数据
	* @param @param visitor
	* @param @return    设定文件 
	* @return List<VisitorInfo>    返回类型 
	* @throws 
	*/
	@Override
	public List<VisitorInfo> getVisitorListByDate(VisitorInfo visitor) {
		return visitorMapper.queryVisitorListByDate(visitor);
	}

	/** 
	* @Title: getVisitorListByPlatform 
	* @Description: 访客柱状图数据 
	* @param @param visitor
	* @param @return    设定文件 
	* @return List<VisitorInfo>    返回类型 
	* @throws 
	*/
	@Override
	public List<VisitorInfo> getVisitorListByPlatform(VisitorInfo visitor) {
		return visitorMapper.queryVisitorListByPlatform(visitor);
	}

	/** 
	* @Title: getVisitorListByChannel 
	* @Description: 按平台各渠道数据 
	* @param @param visitor
	* @param @return    设定文件 
	* @return List<VisitorInfo>    返回类型 
	* @throws 
	*/
	@Override
	public List<VisitorInfo> getVisitorListByChannel(VisitorInfo visitor) {
		return visitorMapper.queryVisitorListByChannel(visitor);
	};
	
	/** 
	* @Title: insertNewVisitorList 
	* @Description: 插入app新访客
	* @param @param visitorList    设定文件 
	* @return void    返回类型 
	* @throws 
	*/
	@Override
	public void insertNewVisitorList(List<VisitorInfo> visitorList){
		visitorMapper.insertNewVisitorList(visitorList);
	}
	
	
	@Override
	public List<VisitorInfo> getRegisterListByDate(VisitorInfo visitor) {
		return visitorMapper.queryRegisterListByDate(visitor);
	}

	@Override
	public List<VisitorInfo> getRegisterListByPlatform(VisitorInfo visitor) {
		return visitorMapper.queryRegisterListByPlatform(visitor);
	}

	@Override
	public List<VisitorInfo> getRegisterListByChannel(VisitorInfo visitor) {
		return visitorMapper.queryRegisterListByChannel(visitor);
	}
	
	
	
	
	
	
	/**
	 *折线图数据
	 * @param
	 * @return
	 */
	@Override
	public List<VisitorInfo> getLineList(VisitorInfo v) {
		return visitorMapper.getLineList(v);
	}

	/**
	 * 折线图安卓ios具体某一天的数据
	 * @param v
	 * @return
	 */
	@Override
	public List<VisitorInfo> getLineAppDetailList(VisitorInfo v){
		return visitorMapper.getLineAppDetailList(v);
	};

	/**
	 * 折线图wap,pc具体某一天的数据
	 * @param v
	 * @return
	 */
	@Override
	public PageInfo<VisitorInfo> getLineOtherDetailList(VisitorInfo v){
		PageHelper.startPage(v.getPage(), v.getPageSize());
		List<VisitorInfo> pro = visitorMapper.getLineOtherDetailList(v);
		PageInfo<VisitorInfo> page = new PageInfo<VisitorInfo>(pro);
		return page;
	};

	/**
	 * 柱状图数据
	 * @param p
	 * @return
	 */
	@Override
	public List<VisitorInfo> getColumnarList(VisitorInfo p){
		return visitorMapper.getColumnarList(p);
	};

	/**
	 * 柱状图wap,pc具体某一天的数据
	 * @param v
	 * @return
	 */
	@Override
	public List<VisitorInfo> getColumnarAppDetailList(VisitorInfo v){
		return visitorMapper.getColumnarAppDetailList(v);
	};

	/**
	 * 柱状图wap,pc具体某一天的数据
	 * @param v
	 * @return
	 */
	public PageInfo<VisitorInfo> getColumnarOtherDetailList(VisitorInfo v){
		PageHelper.startPage(v.getPage(), v.getPageSize());
		List<VisitorInfo> pro = visitorMapper.getColumnarOtherDetailList(v);
		PageInfo<VisitorInfo> page = new PageInfo<VisitorInfo>(pro);
		return page;
	};

	/**
	 * wap,pc具体某一条的数据
	 * @param v
	 * @return
	 */
	@Override
	public List<VisitorInfo> getTableDetailList(VisitorInfo v){
		return visitorMapper.getTableDetailList(v);
	}

}
